{extend name="layout/base" /}
<!-- 标题 -->
{block name="title"}系统设置{/block}
<!-- CSS -->
{block name="css"}{/block}
<!-- 具体内容 -->
{block name="content"}
<h2 class="header-dividing">系统设置 <small>System setting</small></h2>
<form class="form-horizontal" id="form-page-submit" method="post" action="{:url('@admin/setting/save')}">
    <div class="panel">
        {if(check_auth('setting-info'))}
            <div class="panel-heading p0"><div class="hl-default p10">系统调试</div></div>
            <div class="panel-body">
                <div class="col-md-6">
                    <div class="radio-primary">
                        <input type="radio" id="app_debug1" name="app_debug" value="true" {$app_debug ? 'checked' : '' }> 
                        <label for="app_debug1">开启调试功能</label>
                    </div>
                    <div class="radio-primary">
                        <input type="radio" id="app_debug2" name="app_debug" value="false" {$app_debug ? '' : 'checked' }> 
                        <label for="app_debug2">关闭调试功能</label>                            
                    </div>
                </div>
                <div class="col-md-6">
                    <div class="radio-primary">
                        <input type="radio" id="app_trace1" name="app_trace" value="true" {$app_trace ? 'checked' : '' }> 
                        <label for="app_trace1">开启应用trace</label>
                    </div>
                    <div class="radio-primary">
                        <input type="radio" id="app_trace2" name="app_trace" value="false" {$app_trace ? '' : 'checked' }> 
                        <label for="app_trace2">关闭应用trace</label>                            
                    </div>
                </div>
                
            </div>
            <div class="panel-heading p0"><div class="hl-default p10">系统信息</div></div>
            <div class="panel-body">
                <div class="form-group">
                    <label class="col-lg-1 col-md-2 col-sm-2" for="name">系统名称</label>
                    <div class="col-sm-4"><input type="text" class="form-control" id="name" name="setting[name]" placeholder="系统名称" value="{$name}" required></div>
                    <div class="col-sm-2 help-block with-errors"></div>
                </div>
                <div class="form-group">
                    <label class="col-lg-1 col-md-2 col-sm-2" for="website">系统官网</label>
                    <div class="col-sm-4"><input type="text" class="form-control" id="website" name="setting[website]" placeholder="系统官方网址" value="{$website}" required></div>
                    <div class="col-sm-2 help-block with-errors"></div>
                </div>
                <div class="form-group">
                    <label class="col-lg-1 col-md-2 col-sm-2" for="phone">联系电话</label>
                    <div class="col-sm-4"><input type="text" class="form-control" id="phone" name="setting[phone]" placeholder="联系人电话" value="{$phone}" required></div>
                    <div class="col-sm-2 help-block with-errors"></div>
                </div>
                <div class="form-group">
                    <label class="col-lg-1 col-md-2 col-sm-2" for="qq">在线客服</label>
                    <div class="col-sm-4"><input type="text" class="form-control" id="qq" name="setting[qq]" placeholder="在线客服" value="{$qq}" required></div>
                    <div class="col-sm-2 help-block with-errors"></div>
                </div>
                <div class="form-group">
                    <label class="col-lg-1 col-md-2 col-sm-2" for="email">联系邮箱</label>
                    <div class="col-sm-4"><input type="text" class="form-control" id="email" name="setting[email]" placeholder="电子邮箱" value="{$email}" required></div>
                    <div class="col-sm-2 help-block with-errors"></div>
                </div>
            </div>
        {/if}
        {if(check_auth('setting-db'))}
            <div class="panel-heading p0"><div class="hl-default p10">数据库信息</div></div>
            <div class="panel-body">
                <div class="form-group">
                    <label class="col-lg-1 col-md-2 col-sm-2" for="hostname">服务器</label>
                    <div class="col-sm-4"><input type="text" class="form-control" id="hostname" name="database[hostname]" value="{$hostname}" placeholder="服务器地址"></div>
                    <div class="col-sm-2 help-block with-errors">服务器地址</div>
                </div>
                <div class="form-group">
                    <label class="col-lg-1 col-md-2 col-sm-2" for="database">数据库</label>
                    <div class="col-sm-4"><input type="text" class="form-control" id="database" name="database[database]" value="{$database}" placeholder="数据库"></div>
                    <div class="col-sm-2 help-block with-errors">数据库名称</div>
                </div>
                <div class="form-group">
                    <label class="col-lg-1 col-md-2 col-sm-2" for="username">帐号</label>
                    <div class="col-sm-4"><input type="text" class="form-control" id="username" name="database[username]" value="{$username}" placeholder="帐号"></div>
                    <div class="col-sm-2 help-block with-errors">登录帐号</div>
                </div>
                <div class="form-group">
                    <label class="col-lg-1 col-md-2 col-sm-2" for="password">密码</label>
                    <div class="col-sm-4"><input type="password" class="form-control" id="password" name="database[password]" value="{$password}" placeholder="密码"></div>
                    <div class="col-sm-2 help-block with-errors">登录密码</div>
                </div>
                <div class="form-group">
                    <label class="col-lg-1 col-md-2 col-sm-2" for="prefix">表格前缀</label>
                    <div class="col-sm-4"><input type="text" class="form-control" id="prefix" name="database[prefix]" value="{$prefix}" placeholder="表格前缀"></div>
                    <div class="col-sm-2 help-block with-errors">表格前缀</div>
                </div>
                <div class="form-group">
                    <label class="col-lg-1 col-md-2 col-sm-2" for="hostport">端口</label>
                    <div class="col-sm-4"><input type="text" class="form-control" id="hostport" name="database[hostport]" value="{$hostport}" placeholder="端口"></div>
                </div>
            </div>
        {/if}
        <div class="panel-footer text-center">
            <button type="submit" class="btn btn-primary btn-submit">保存信息</button>
        </div>
    </div>
</form>
{/block}


<!-- JS -->
{block name="js"}
    {load href="/static/lib/jquery/jquery.form.js"}
    {load href="/static/lib/validator/validator.min.js"}
{/block}